package texture;

import java.util.List;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class TexturePacket {
	public TextureAtlas atlas;
	static TexturePacket self;

	public static TexturePacket getInstance() {
		if (self != null) {
			return self;
		}
		return new TexturePacket();
	}

	public TexturePacket() {
		atlas = new TextureAtlas(Gdx.files.internal("res/pack"));
		self = this;
		// List<> regions = (List<AtlasRegion>) atlas.findRegion("f1");
		// List<TextureRegion> regions = (List<TextureRegion>) atlas
		// .findRegion("f1");
	}

	public TextureRegion[] getRegions(String fname) {
		List<TextureRegion> regions = (List<TextureRegion>) atlas.findRegion("f1");
		return (TextureRegion[]) regions.toArray();
	}
}
